﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace homeworkhero
{
    public class FloatingProblem
    {
        private Texture2D tex;
        private Stage stage;
        private Vector2 position;

        public FloatingProblem(Stage s, Texture2D tex, Vector2 position) {
            this.stage = s;
            this.tex = tex;
            this.position = position;
        }

        public Vector2 getScreenPosition()
        {
            Vector2 realPos = position;

            // calculate x position based on stage stuff
            realPos.X = (Game1.SCREENWIDTH / 3.0f) - stage.getPlayerX() + realPos.X;
            realPos.Y = Game1.SCREENHEIGHT - (realPos.Y * Game1.LAYERHEIGHT);
            return realPos;
        }

        public void draw(SpriteBatch b) {
            b.Draw(tex, getScreenPosition(), null, Color.White, 0.0f, Vector2.Zero, 1.0f, SpriteEffects.None, 0.99999f);
        }
    }
}
